package cn.sccl.dirms.security.model;

import cn.sccl.common.exception.BusinessException;
import cn.sccl.common.model.BaseModel;

/**
* 机构ID
* 数据库表 T_SEC_UNIT 的实体对象
* Created by P650RE3 on 2016-10-19.
*/
public class Unit extends BaseModel{
/**
*表名
*/
public final static String TABLE_NAME ="t_sec_unit";

    private java.lang.String name;//机构名称
    private java.lang.String parentId;//上级机构ID
    private boolean setup;//1,文字，2视频
    private java.lang.String imageUrl;//图片地址：相对目录地址
    private boolean showText;//是否显示文字 0不显示，1显示
    private java.lang.String content;//欢迎内容文字
    private java.lang.String videourl;//视频地址

    public void setName(java.lang.String name){
    this.name = name;
    }

        public java.lang.String getName(){
    return this.name;
    }
    public void setParentId(java.lang.String parentId){
    this.parentId = parentId;
    }

        public java.lang.String getParentId(){
    return this.parentId;
    }
    public void setSetup(boolean setup){
    this.setup = setup;
    }

        public boolean isSetup(){
    return this.setup;
    }
    public void setImageUrl(java.lang.String imageUrl){
    this.imageUrl = imageUrl;
    }

        public java.lang.String getImageUrl(){
    return this.imageUrl;
    }
    public void setShowText(boolean showText){
    this.showText = showText;
    }

        public boolean isShowText(){
    return this.showText;
    }
    public void setContent(java.lang.String content){
    this.content = content;
    }

        public java.lang.String getContent(){
    return this.content;
    }
    public void setVideourl(java.lang.String videourl){
    this.videourl = videourl;
    }

        public java.lang.String getVideourl(){
    return this.videourl;
    }

/**
* clone一个对象。
* @param cls 需要克隆的对象类型，只能是当前类的子类
* @param
<T>
    * @return
    * @throws IllegalAccessException
    * @throws InstantiationException
    */
    public
    <T extends Unit> T clone(Class
        <T> cls) {
            try {
            T t = cls.newInstance();
            t.setId(this.
            getId());
            t.setCreateTime(this.
            getCreateTime());
            t.setUpdateTime(this.
            getUpdateTime());
            t.setDeleteFlag(this.isDeleteFlag());
            t.setName(this.
            getName());
            t.setParentId(this.
            getParentId());
            t.setSetup(this.isSetup());
            t.setImageUrl(this.
            getImageUrl());
            t.setShowText(this.isShowText());
            t.setContent(this.
            getContent());
            t.setVideourl(this.
            getVideourl());
            return t;
            } catch (Exception e) {
            e.printStackTrace();
            throw new BusinessException("对象克隆失败，请克隆的目标对象是否具有无参的构造函数。", e.getCause());
            }
            }
            }